import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class BaseMapWidget extends StatefulWidget {
  final dynamic creationParams;
  const BaseMapWidget({Key? key, this.creationParams}) : super(key: key);

  @override
  State<BaseMapWidget> createState() => _BaseMapWidgetState();
}

class _BaseMapWidgetState extends State<BaseMapWidget> {
  static const String view_type = 'aha_map_view';
  @override
  Widget build(BuildContext context) {
    if (defaultTargetPlatform == TargetPlatform.iOS) {
      return UiKitView(
        viewType: view_type,
        creationParams: widget.creationParams,
        onPlatformViewCreated: (int id){
        },
        creationParamsCodec: new StandardMessageCodec(),
      );
    } else {
      return AndroidView(
          viewType: view_type,
          creationParams: widget.creationParams,
          onPlatformViewCreated: (int id){
          },
          creationParamsCodec: const StandardMessageCodec());
    }
  }
}
